<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<f:view>
	<f:metadata>
		<f:viewAction action="#{menuMB.updateMenu(11)}" />
	</f:metadata>
	<ui:composition template="/WEB-INF/templates/defaultLayout.xhtml">

		<!-- Definiendo la cabecera de la pagina -->
		<ui:define name="title">
			<h:outputText value="Caja" />
		</ui:define>

		<!-- Definiendo el cuerpo de la pagina -->
		<ui:define name="content">
			<h:outputStylesheet library="css" name="main.css" />
			<br />
			<h:form>
				<p:focus for="txtDenominacion"/>
				<div style="margin-left: 50px;">
					<div>
						<div>
							<div class="p6n-api-consent-screen-title">Crear Caja</div>
							<div class="p6n-api-consent-screen-inputs">
								<div class="p6n-api-consent-screen-input-section">
									<div class="p6n-api-consent-screen-label" style="width: 150px;">
										AGENCIA</div>
									<div>
										<h:outputLabel style="font-weight: bold;" value="#{cajaCRUDBean.agencia.denominacion}" />
									</div>
								</div>
								<div class="p6n-api-consent-screen-input-section">
									<div class="p6n-api-consent-screen-label">DENOMINACION</div>
									<div>
										<div>
											<h:inputText id="txtDenominacion" autocomplete="off"
												value="#{cajaCRUDBean.denominacion}" maxlength="150"
												required="true" onkeyup="this.value = this.value.toUpperCase();"
												requiredMessage="Denominacion no debe de ser vacio" />
										</div>
									</div>
								</div>
								<div
									class="p6n-api-consent-screen-input-error p6n-api-consent-screen-product-name-error-msg">
									<h:message for="txtDenominacion" />
								</div>
								<div class="p6n-api-consent-screen-input-section">
									<div class="p6n-api-consent-screen-label" style="width: 150px;">ABREVIATURA</div>
									<div>
										<h:inputText id="txtAbreviatura" autocomplete="off"
											value="#{cajaCRUDBean.abreviatura}" maxlength="150"
											required="true" onkeyup="this.value = this.value.toUpperCase();"
											requiredMessage="Abreviatura no debe de ser vacio" />
									</div>
								</div>
								<div
									class="p6n-api-consent-screen-input-error p6n-api-consent-screen-product-name-error-msg">
									<h:message for="txtAbreviatura" />
								</div>
								<div class="p6n-api-consent-screen-input-section">
									<div class="p6n-api-consent-screen-label" style="width: 150px;">BOVEDAS ASIGNADAS
										</div>
									<div>
										<p:pickList id="pickBovedas"
											value="#{cajaCRUDBean.dualListModelBoveda}" var="boveda"
											itemLabel="#{boveda}" itemValue="#{boveda}"
											converter="DualPickListConverter" required="true"
											requiredMessage="Seleccione por lo menos una boveda">
											<f:facet name="sourceCaption">Bovedas No Asignados</f:facet>  
        									<f:facet name="targetCaption">Bovedas Asignados</f:facet>
										</p:pickList>
									</div>
								</div>
								<div
									class="p6n-api-consent-screen-input-error p6n-api-consent-screen-product-name-error-msg">
									<h:message for="pickBovedas" />
								</div>
								<div class="p6n-api-consent-screen-input-section">
									<div class="p6n-api-consent-screen-label" style="width: 150px;">USUARIOS ASIGNADOS
										</div>
									<div>
										<p:pickList id="pickListUsuarios"
											value="#{cajaCRUDBean.dualListModelUsuario}" var="usuario"
											itemLabel="#{cajaCRUDBean.nombreUsuario(usuario)}" itemValue="#{usuario}"
 											converter="UsuarioDualPickListConverter"
											requiredMessage="Seleccione por lo menos un usuario">
											<f:facet name="sourceCaption">Usuarios No Asignados</f:facet>  
        									<f:facet name="targetCaption">Usuarios Asignados</f:facet>
										</p:pickList>
									</div>
								</div>
								<div
									class="p6n-api-consent-screen-input-error p6n-api-consent-screen-product-name-error-msg">
									<h:message for="pickListUsuarios" />
								</div>
								<div class="sf-buttons" style="float: left;">
									<h:commandButton actionListener="#{cajaCRUDBean.createCaja()}"
										action="list?faces-redirect=true" value="Guardar"
										styleClass="action blue" onclick="onSubmitButton();" />
									<h:commandButton value="Cancelar"
										action="list?faces-redirect=true" immediate="true"
										styleClass="action" />
								</div>
							</div>
						</div>
					</div>
				</div>
			</h:form>
		</ui:define>

	</ui:composition>
</f:view>
</html>